package com.cskaoyan.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@AllArgsConstructor
@Data
public class GoodsProduct {
    private Integer id;

    private Integer goodsId;

    @NotNull(message = "商品规格值列表不能为空")
    private String[] specifications;

    @NotNull(message = "商品货品价格不能为空")
    @DecimalMin(value = "0", message = "商品货品价格必须大于或等于0")
    private BigDecimal price;

    @NotNull(message = "商品货品数量不能为空")
    @DecimalMin(value = "0", message = "商品货品数量必须大于等于0")
    private Integer number;

    private String url;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date addTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private Boolean deleted;
}